<%@ page import="com.casework.LegalCase" %>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'ecNumber', 'error')} ">
    <label for="ecNumber">
        <g:message code="legalCase.ecNumber.label" default="EC Number"/>
        <span class="required-indicator">*</span>
    </label>
    <g:textField name="ecNumber" value="${legalCaseInstance?.ecNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'phase', 'error')} required">
    <label for="phase">
        <g:message code="legalCase.phase.label" default="Phase"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select name="phase" from="${1..2}"
              required=""
              value="${legalCaseInstance?.phase}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'notificationDate', 'error')} ">
    <label for="notificationDate">
        <g:message code="legalCase.notificationDate.label" default="Notification Date"/>

    </label>
    <g:render template="/templates/date" model="[date:legalCaseInstance?.notificationDate, varName: 'notificationDate']"/>
    
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'decisionDate', 'error')} ">
    <label for="decisionDate">
        <g:message code="legalCase.decisionDate.label" default="Decision Date"/>

    </label>
    <g:render template="/templates/date" model="[date:legalCaseInstance?.decisionDate, varName: 'decisionDate']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'ph1Offer', 'error')} required">
    <label for="ph1Offer">
        <g:message code="legalCase.ph1Offer.label" default="Ph1 Offer"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select name="ph1Offer" from="${com.casework.YesNoNoData?.values()}"
              keys="${com.casework.YesNoNoData.values()*.name()}" noSelection="['': '']"
              value="${legalCaseInstance?.ph1Offer?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'dateOfStatementOfObjections', 'error')} ">
    <label for="dateOfStatementOfObjections">
        <g:message code="legalCase.dateOfStatementOfObjections.label" default="Date Of Statement Of Objections"/>

    </label>
    <g:render template="/templates/date" model="[date:legalCaseInstance?.dateOfStatementOfObjections, varName: 'dateOfStatementOfObjections']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'relativeToSO', 'error')} required">
    <label for="relativeToSO">
        <g:message code="legalCase.relativeToSO.label" default="Relative To SO"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select name="relativeToSO" from="${com.casework.RelativeToSO?.values()}"
              keys="${com.casework.RelativeToSO.values()*.name()}" noSelection="['': '']"
              value="${legalCaseInstance?.relativeToSO?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'typeA', 'error')} required">
    <label for="typeA">
        <g:message code="legalCase.typeA.label" default="Type A"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select name="typeA" from="${com.casework.TypeA?.values()}" keys="${com.casework.TypeA.values()*.name()}"
              noSelection="['': '']" value="${legalCaseInstance?.typeA?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'typeB', 'error')} required">
    <label for="typeB">
        <g:message code="legalCase.typeB.label" default="Type B"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select name="typeB" from="${com.casework.TypeB?.values()}" keys="${com.casework.TypeB.values()*.name()}"
              noSelection="['': '']" value="${legalCaseInstance?.typeB?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'dealType', 'error')} required">
    <label for="dealType">
        <g:message code="legalCase.dealType.label" default="Deal Type"/>
        <span class="required-indicator">*</span>
    </label>
    <g:select id="dealType" name="dealType.id" from="${com.casework.DealType.list()}" optionKey="id" required=""
              value="${legalCaseInstance?.dealType?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: legalCaseInstance, field: 'commentOnOffers', 'error')} ">
    <label for="commentOnOffers">
        <g:message code="legalCase.commentOnOffers.label" default="Comment On Offers"/>

    </label>
    <g:textArea rows="5" cols="0" name="commentOnOffers" value="${legalCaseInstance?.commentOnOffers}"/>
</div>

<r:script>
$(function() {
    $('textArea').cleditor({
          width:        700, // width not including margins, borders or padding
          height:       250, // height not including margins, borders or padding
          controls:     // controls to add to the toolbar
                        "bold italic underline " +
                        "style | color highlight removeformat | bullets numbering | " +
                        "undo redo | " +
                        "| cut copy paste pastetext",
          colors:       // colors in the color popup
                        "FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF " +
                        "CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F " +
                        "BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C " +
                        "999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C " +
                        "666 900 C60 C93 990 090 399 33F 60C 939 " +
                        "333 600 930 963 660 060 366 009 339 636 " +
                        "000 300 630 633 330 030 033 006 309 303",
          fonts:        // font names in the font popup
                        "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
                        "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
          sizes:        // sizes in the font size popup
                        "1,2,3,4,5,6,7",
          styles:       // styles in the style popup
                        [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
                        ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
                        ["Header 6","<h6>"]],
          useCSS:       false, // use CSS to style HTML when possible (not supported in ie)
          docType:      // Document type contained within the editor
                        '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
          docCSSFile:   // CSS file used to style the document contained within the editor
                        "",
          bodyStyle:    // style to assign to document body contained within the editor
                        "margin:4px; font:10pt Arial,Verdana; cursor:text"
    });
});
</r:script>